<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<!--  查看全部学生 -->
    <base href="<%=basePath%>">
    <title>学生信息</title>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
    <link rel="stylesheet" type="text/css" href="<%=path %>/css/f/default.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/navs.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/assignment.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/Ls.css"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
</head>
<body>
	<div class="all">
		<jsp:include page="/nav.jsp"></jsp:include>
        <div class="rightall float-left" id="zcorse-yi">
            <div class="already">
            	<div class="already-title" >
            		<div class="left">学生信息</div>
            	</div>
            	<div style="margin-top:10px;">
            	<form action="counselor/stuInfo.do" method="post">
                    <span style="margin-left:200px;width:10%">专业:</span>
                    <select class="task" name="majorName">
                    		<c:forEach var="maj" items="${maj}">
	                            <option value="${maj.majorName}">${maj.majorName }</option>
                    		</c:forEach>
                    </select>
                    <span style="margin-left:20px;width:10%">班级:</span>
                    <select class="task" name="className">
                    		<c:forEach var="cla" items="${cla }">
	                            <option value="${cla.className}">${cla.className}</option>
                    		</c:forEach>
                    </select>
                    <input class="task" type="text" name="student"  placeholder="学号/学生姓名/">
                    <button type="submit" style="width: 10%" class="task btn-style">查询</button>
	            </form>
	            </div>
	            <table>
	                <tr class="tr-style-head">
	                	<td>学号</td>
	                    <td>姓名</td>
	                    <td>性别</td>
	                    <td>QQ</td>
	                    <td>电话</td>
	                    <td>住址</td>
	                    <td>修改</td>
	                    <td>校园经历</td>
	                </tr>
	                <c:forEach var="stu" items="${stu }">
		                <tr class="tr-style">
		                	<td>${stu.stuNo }</td>
		                    <td>${stu.stuName }</td>
		                    <td>${stu.stuSex }</td>
		                    <td>${stu.stuQq }</td>
		                    <td>${stu.stuPhone }</td>
		                    <td>${stu.stuEmail }<c:if test="${a==null }"><input type="hidden" id="b" value="${stu.stuClassName }"></c:if>
		                    <c:if test="${a!=null }"><input type="hidden" id="b" value=""></c:if></td>
		                    <td><a id="a"  class="a-red" onclick="cha()">修改</a><input type="hidden" value="${stu.stuNo}"/></td>
		                    <td><a href="c/course.jsp" class="a-red" >校园经历</a></td>
		                </tr>
	                </c:forEach>
	            </table>
	                	<c:if test="${pages > 1 }">
		               		<div class="previous">
			               		<c:if test="${pageNo>1}">
			                    	<a id="runoob">上一页</a>
			                	</c:if>
			                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
			                   		<c:if test="${p==pageNo }">
			                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
			                   		</c:if>
			                   		<c:if test="${p!=pageNo }">
			                   			<a href="counselor/stuInfo.do?pageNo=${p }" >&nbsp;${p}&nbsp;</a>
			                   		</c:if>
			                   	</c:forEach>
			                    <c:if test="${pageNo<pages}">
			                    	<a id="runaab" >下一页</a>
			                	</c:if>
		                   	</div>
		                </c:if>
	        </div>
	     </div>
        <div class="rightall float-left" id="zcorse-yi—ren">
	        <div class="already">
            	<div class="already-title">
            		<div class="left">学生信息修改</div>
            		<div class="left float-right"><a class="a-color-write" onclick="hui()">返回</a></div>
            	</div>
            	<div style="margin-top:10px;">
            	<form action="counselor/updateStuInfo.do" method="post">
                    <input  id="ll" class="task" type="text" name="studentId"  placeholder="学号/学生姓名/">
                    <span style="margin-left:20px;width:10%">修改项:</span>
                    <select class="task" name="updateStu">
                            <option value="1">所属班级名称</option>
                            <option value="2">所属小组id</option>
                            <option value="3">所属寝室名称</option>
                            <option value="4">学生电话</option>
                            <option value="5">学生住址</option>
                            <option value="6">学生QQ</option>
                            <option value="7">学生邮箱</option>
                    </select>
                    <span style="margin-left:20px;width:10%">修改内容:</span>
                    <input class="task" type="text" name="updateValue"  placeholder="修改内容">
                    <button type="submit" style="width: 10%" class="task btn-style">修改</button>
	            </form>
	            </div>
	        </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="js/f/jquery.min.js"></script>
<script type="text/javascript">
    var cha=function(){
       var c=document.getElementById("zcorse-yi");
       c.style.display="none";
       var d=document.getElementById("zcorse-yi—ren");
       d.style.display="block";
    }
    var hui=function(){
       document.getElementById("zcorse-yi").style.display="block";
       document.getElementById("zcorse-yi-ren").style.display="none";
    }
    $(function(){
    	var stuNo=null;
    	$("#a").click(function(){
    		stuNo = $(this).siblings().val();
    		$("#ll").val(stuNo);
    	 });
    	 
    	 var stuClassName=$("#b").val();
    	 if(stuClassName==null){
	    	 $("#runoob").attr({
	        	"href" : "counselor/stuInfo.do?pageNo=${pageNo-1}"
	    	});
	    	 $("#runaab").attr({
	        	"href" : "counselor/stuInfo.do?pageNo=${pageNo+1}"
	    	});
    	 }else{
	    	 $("#runoob").attr({
	        	"href" : "counselor/stuInfo.do?pageNo=${pageNo-1}&&className="+stuClassName
	    	});
	    	 $("#runaab").attr({
	        	"href" : "counselor/stuInfo.do?pageNo=${pageNo+1}&&className="+stuClassName
	    	});
    	 	
    	 }
    });
</script>
</html>
